package com.guchenbo.example.equals;

/**
 * Created by CreGu on 2016/6/12.
 */
public class TestEquals {
    public static void main(String[] args) {
//        Person
        Person p1 = new Person("jay", 20);
        Person p2 = new Person("jay", 20);

        System.out.println(p1 == p2);
        System.out.println(p1.equals(p2));
//      Person2
        Person2 p3 = new Person2("jay", 20);
        Person2 p4 = new Person2("jay", 20);

        System.out.println(p3 == p4);
        System.out.println(p3.equals(p4));
//      Person3
        Person3 p5 = new Person3("jay", 20);
        Person3 p6 = new Person3("jay", 20);

        System.out.println(p5 == p6);
        System.out.println(p5.equals(p6));
    }


}
